package com.appspot.inkisapi.service;

import java.util.List;

import com.appspot.inkisapi.entity.BlogPost;

public class BlogPostService {
	public static void addOrUpdateBlogPost(BlogPost bp) {
		OfyService.ofy().save().entity(bp);
	}
	
	public static BlogPost getBlogPost(String id){
		BlogPost bp = OfyService.ofy().load().type(BlogPost.class).id(id).get();
		return bp;
	}
	
	public static List<BlogPost> getAllBlogPosts(){
		return OfyService.ofy().load().type(BlogPost.class).list();
	}
	
	public static void deleteBlogPost(String id){
		OfyService.ofy().delete().type(BlogPost.class).id(id).now();
	}
}
